import request from '@/config/axios'

export interface FilePageReqVO extends PageParam {
  path?: string
  type?: string
  createTime?: Date[]
}

// 查询文件列表
export const getFilePage = (params: FilePageReqVO) => {
  return request.getOriginal({ url: '/infra/file/page', params })
}

// 删除文件
export const deleteFile = (id: number) => {
  return request.delete({ url: '/infra/file/delete?id=' + id })
}

// 换取下载地址
export const fileExchange = (filePath) => {
  return request.get({ url: `/infra/file/exchange?filePath=${filePath}` })
}

// 下发文件
export const issuaFile = (data) => {
  return request.post({ url: `/amp/file-manage/issue`, data })
}
